var FinishScene01 = cc.Scene.extend({
	onEnter:function () {
		this._super();
		var back_layer = new FinishBackLayer01(this);
		back_layer.menu.setLocalZOrder(-1);

		var layer = new FinishLayer();
		this.addChild(layer,2);
		layer.bake();
	},
	backClicked: function () {// 返回按钮
		cc.director.end();
	},
	menuClicked:function(){// 菜单按钮
	}
});

var FinishLayer = cc.Layer.extend({
	ctor:function () {
		this._super();
		this.loadFire();
		this.loadTip();
		return true;
	},
	loadFire: function(){
		new FireWork(this);
	},
	loadTip:function(){
		this.tip = new Tip("恭喜过关", gg.width * 0.85);
		this.addChild(this.tip, 10);
		this.tip.runAction(
				cc.spawn(
						cc.moveTo(2, cc.p(gg.width * 0.5 - this.tip.width, gg.height * 0.5)),
						cc.tintTo(2,231,64,25),
						cc.scaleTo(2,2)
				)
		);
		_.over();
		this.scheduleOnce(function(){
			this.loadStartButton();
		},3);
	},
	loadStartButton : function(){
		this.restart = new cc.MenuItemImage(
				"#finish_restart1.png",
				"#finish_restart2.png",
				this.eventMenuCallback,this);
		this.restart.setPosition(gg.width * 0.5, gg.height * 0.4);
		var menu = new cc.Menu();
		this.addChild(menu);
		menu.setPosition(0, 0);
		menu.addChild(this.restart);
	},
	eventMenuCallback: function(pSender) {
		cc.audioEngine.stopMusic();
		$.runScene(new StartScene01())
	}
});